<template>
  <div>
    <c-title :hide="false" :text="'律师管理'"></c-title>
    <header class="header">
      <div class="header-content">
        <img :src="avatar" alt="" />
        <div class="flex column left">
          <span class="header-nickname">{{name}}</span>
        </div>
      </div>
    </header>
    <van-cell title="基本信息" is-link @click="link('info')" />
    <van-cell title="服务设置" is-link  @click="link('serve')"  />
    <van-cell title="订单管理" is-link  @click="link('order')" />
    <van-cell title="消息" is-link  @click="link('message')"/>
    <van-cell title="分红记录" is-link @click="link('share')"/>
  </div>
</template>

<script>
export default {
  data(){
    return {
      lawyer_ID:"",
      name:"",
      avatar:''
    }
  },
  mounted(){
    this.getData();
  },
  methods:{
    link(type){
      if(type == 'share'){
        this.$router.push(this.fun.getUrl("lawyerShare",{order_type:'lawyer'}))
      }else if(type == 'order'){
        this.$router.push(this.fun.getUrl("lawyerOrder",{},{order_type:'lawyer'}))
      }else if(type =='serve'){
        this.$router.push(this.fun.getUrl("lawYerManagement_edit",{id:this.lawyer_ID}))
      }else if(type == 'info'){
         this.$router.push(this.fun.getUrl("lawyerPlatformApplyFor",{},{apply_for:'lawyerDetail'}))
      }else{
          this.$router.push(this.fun.getUrl("lawyerChart",{},{l_id:this.lawyer_ID,message_type:2}))
      }
    },
    getData(){
      $http.get("plugin.lawyer-platform.frontend.controllers.lawyer.index").then(res =>{
        if(res.result == 1){
          this.avatar = res.data.lawyer.avatar_image
          this.name=res.data.lawyer.name;
          this.lawyer_ID=res.data.lawyer.id;
        }
      })
    }
  }
};
</script>

<style lang="scss" scoped>
::v-deep .van-cell__title {
  text-align: left;
}

.header {
  height: 7rem;
  background-image: linear-gradient(0deg, #d5a74f 0%, #f8e088 100%);

  &-content {
    height: inherit;
    display: flex;
    align-items: center;
    padding-left: 1.4285rem;
  }

  img {
    margin: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 100px;
    object-fit: cover;
    border: 1px solid #fff;
    margin-right: 0.6428rem;
  }

  &-nickname {
    color: #845002;
    font-size: 1.142rem;
    line-height: 2.0714rem;
    font-weight: 800;
  }

  &-infoId {
    color: #874f02;
    font-size: 0.857rem;
    line-height: 1.5714rem;
  }
}
</style>
